<%-- 
    Document   : index
    Created on : 15-03-2012, 01:36:39
    Author     : UTAN
--%>

<%
String cookieName = "username";
String un = new String();
Cookie cookies [] = request.getCookies ();
Cookie myCookie = null;

if (cookies != null)
{
for (int i = 0; i < cookies.length; i++) 
{
if (cookies [i].getName().equals (cookieName))
{
myCookie = cookies[i];
un= myCookie.getValue();
break;
}
}
}
else
{
    un="";
}
%>

<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body>
        <form method="post" action="./Output">
        <table border="0">
            <tr><td>Username:</td><td><input type="text" name="un" value="<%=un%>"/></td></tr>
            <tr><td>Password:</td><td><input type="password" name="pw"/></td></tr>
            <tr><td colspan="2"><button value="submit" name="submit" type="submit">Submit</button></td></tr>
        </table>
        </form>
    </body>
</html>
